package com.zmn.mcc.manager.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author heguanghua
 * @since 2020/04/23 14:52
 */
@Configuration
public class MccConfig implements Serializable {
    private static final long serialVersionUID = -2547281579301592337L;

    /**
     * 超级管理员
     */
    @Value("${mcc.role.super-admin:101}")
    private Integer superAdminRoleId;

    /**
     * 权限管理员角色
     */
    @Value("${mcc.role.assign-admin:101}")
    private Integer assignAdminRoleId;

    /**
     * 同步北森职务时需要忽略的角色
     */
    @Value("#{'${mcc.role.ignored-role:}'.split(',')}")
    private List<Integer> ignoredRoleIds = new ArrayList<>(0);

    /**
     * 权限管理员角色的权限清单
     */
    @Value("#{'${mcc.permit.assign-admin:}'.split(',')}")
    private List<Integer> assignAdminPermitIds = Collections.EMPTY_LIST;


    /**
     * 允许的登录密码错误最大次数
     */
    @Value("${mcc.staff.login-error-limit:5}")
    private Integer loginErrorLimit;

    /**
     * 允许的数据导出数量系统上限
     */
    @Value("${mcc.staff.data-export-limit:10000}")
    private Integer dataExportLimit;

    /**
     * 允许的查询前溯天数系统上限
     */
    @Value("${mcc.staff.data-day-limit:30}")
    private Integer dataDayLimit;

    /**
     * 允许的查询最大条数限制
     */
    @Value("${mcc.staff.data-number-limit:1000}")
    private Integer dataNumberLimit;


    public Integer getSuperAdminRoleId() {
        return superAdminRoleId;
    }

    public Integer getAssignAdminRoleId() {
        return assignAdminRoleId;
    }

    public List<Integer> getIgnoredRoleIds() {
        return ignoredRoleIds;
    }

    public List<Integer> getAssignAdminPermitIds() {
        return assignAdminPermitIds;
    }

    public Integer getLoginErrorLimit() {
        return loginErrorLimit;
    }

    public Integer getDataExportLimit() {
        return dataExportLimit;
    }

    public Integer getDataDayLimit() {
        return dataDayLimit;
    }

    public Integer getDataNumberLimit() {
        return dataNumberLimit;
    }

    public void setDataNumberLimit(Integer dataNumberLimit) {
        this.dataNumberLimit = dataNumberLimit;
    }
}
